<?php
/**
 * 
 * ULog.php
 * @author noskill
 * 
 * 
 * 
 */
/**
 * ULog
 * 
 * @author mw
 * @package Utility
 */
class ULog extends UUtility{
	/**
	 * Handle del file
	 * @var unknown_type
	 */
	private $file;
	/**
	 * Nome file
	 * @var unknown_type
	 */
	protected $nome_file = DEBUG_FILE;
	/**
	 * Costruttore
	 */
	public function __construct() {
		if(DEBUG == true){
			$this->file = fopen($this->nome_file, 'a');
		}
	}
	/**
	 * Log
	 * @param string $var
	 */
	public function log($var) {
		if(DEBUG == true){
			fwrite($this->file,date('d/m/Y H:i:s ').$var."\n");
		}
	}
	/**
	 * Distruttore
	 */
	public function __destruct() {
		if(DEBUG == true){
			fclose($this->file);
		}
	}
}